﻿using UnityEngine;

[CreateAssetMenu(fileName = "GameSettings", menuName = "Settings/GameSettings")]
public class GameSettings : ScriptableObject
{
    public float playerSpeed = 5f;
    public int maxHealth = 100;
}
[CreateAssetMenu(fileName = "GameSettings1", menuName = "Settings/GameSettings1")]
public class GameSettings1 : ScriptableObject
{
    public float speed = 5f;
    public int health = 100;
    public GameObject[] game;
}

// 使用
public class Player : MonoBehaviour
{
    public GameSettings settings;

    void Start()
    {
        Debug.Log("Player Speed: " + settings.playerSpeed);
    }
}